package com.mingqijia.gassafety.authority.api.req.manager;

import com.mingqijia.gassafety.shared.constant.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户登录请求参数
 * @author Damon S.
 * @version v1.0.1
 * @date 2020年08月02日 23:08
 */
@Data
@ApiModel(value = "管理员登录请求参数")
public final class ManagerLoginReqDTO implements Serializable {

    @NotNull(message = "请输入2-16位汉字、字母、数字")
    @ApiModelProperty(value = "账号", required = true)
    @Pattern(regexp = Constants.REGEXP_USERNAME, message = "账号应满足2-16位汉字、字母、数字")
    private String username;

    @NotNull(message = "请输入6-20位数字+字母+特殊字符")
    @ApiModelProperty(value = "密码(提交32位md5编码字符)-格式：md5(password+username)", required = true)
    @Pattern(regexp = Constants.REGEXP_PWD_MD5, message = "只能包含6-20位数字+小写字母+大写字母+特殊字符")
    private String password;

//    @NotNull(message = "电话不能为空")
//    @ApiModelProperty(value = "电话", required = true)
//    @Pattern(regexp = Constants.REGEXP_PHONE, message = "手机号码不合法")
//    private String phone;

    @NotNull(message = "请输入验证码")
    @ApiModelProperty(value = "验证码", required = true)
    private String captcha;
}
